﻿using UnityEngine;
using System.Collections;
using System.IO;

namespace common
{
	public class DataRead 
	{
		public static string ReadUTFString(ref BinaryReader pStream)
		{
			int numChar = pStream.ReadUInt16 ();
			if (numChar == 0) 
			{
				return string.Empty;
			}
			byte[] data = new byte[numChar];
			for (int i = 0; i < numChar; i ++) 
			{
				data [i] = (byte)pStream.ReadUInt16 ();
			}
			string str = System.Text.Encoding.UTF8.GetString (data);
			data = null;
			return str;
		}
	}
}